package com.huawei.appmarket.service.store.awk.card;

import android.content.Context;
import android.graphics.drawable.Drawable;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;
import android.widget.TextView;
import com.huawei.appgallery.foundation.ui.framework.cardkit.bean.CardBean;
import com.huawei.appgallery.horizontalcard.api.card.BaseHorizontalItemCard;
import com.huawei.appmarket.framework.widget.RoundCornerLayout;
import com.huawei.appmarket.service.store.awk.bean.SubstanceListCardBean;
import o.cgz;
import o.chc;
import o.dof;
import o.ContentManager;
import o.epv;
import o.eqx;
import o.evf;
import o.ewm.d;
import o.ewm.e;
import o.ewm.h;
import o.ewm.j;
import o.fmw;

public class VerticalMaterialListItemCard extends BaseHorizontalItemCard {
    private TextView ʻ;
    private RoundCornerLayout ʼ;
    private TextView ʽ;
    private ImageView ˋ;
    private TextView ॱॱ;
    private LinearLayout ᐝ;

    public VerticalMaterialListItemCard(Context context) {
        super(context);
    }

    public cgz ˏ(View view) {
        this.ˋ = (ImageView) view.findViewById(j.ˊʹ);
        this.ʻ = (TextView) view.findViewById(j.ˊי);
        this.ʽ = (TextView) view.findViewById(j.ˊٴ);
        this.ॱॱ = (TextView) view.findViewById(j.ㆍʼ);
        this.ʼ = (RoundCornerLayout) view.findViewById(j.ॱـ);
        this.ᐝ = (LinearLayout) view.findViewById(j.ˊՙ);
        int ˎ = epv.ˎ(this.ʼॱ, ʻ(), chc.ˋ());
        this.ʼ.setLayoutParams(new LayoutParams(ˎ, (int) (((float) ˎ) * epv.ʼ())));
        LayoutParams layoutParams = (LayoutParams) this.ᐝ.getLayoutParams();
        layoutParams.width = ˎ;
        this.ᐝ.setLayoutParams(layoutParams);
        ʽ(view);
        return this;
    }

    public void ˏ(CardBean cardBean) {
        super.ˏ(cardBean);
        if (cardBean instanceof SubstanceListCardBean) {
            SubstanceListCardBean substanceListCardBean = (SubstanceListCardBean) cardBean;
            String str = (String) this.ˋ.getTag();
            if (dof.ˋ(str) || !str.equals(substanceListCardBean.ʻᐝ())) {
                if (evf.ˊ(this.ˋ)) {
                    this.ˋ.setImageDrawable((Drawable) fmw.ˏ(this.ˋ.getContext(), e.ꜞ, "drawable"));
                } else {
                    this.ˋ.setImageResource(e.ꜞ);
                }
                Context ˋ = ContentManager.getInstant().getContext();
                eqx.ˋ(ˋ.getResources().getDimensionPixelSize(d.ॱʽ), ˋ.getResources().getDimensionPixelSize(d.ॱʼ), this.ˋ, substanceListCardBean.ʻᐝ(), "image_default_icon");
                this.ˋ.setTag(substanceListCardBean.ʻᐝ());
                this.ʻ.setText(substanceListCardBean.ʾॱ());
                this.ʽ.setText(substanceListCardBean.ʽˊ());
                ˋ(this.ॱॱ, substanceListCardBean.ˋʻ());
                ᐝ(this.ʽ);
            }
        }
    }

    private int ʻ() {
        return chc.ʼ();
    }

    public int ˎ() {
        return h.ᐝﾞ;
    }

    public int ˊ() {
        return h.ᐝﾞ;
    }
}
